package cn.bluedot.bean;

import java.util.List;

public class PageBean<T> {
    //当前页码
    private Integer page;
    //每页限制条数
    private Integer pageSize;
    //是否启动插件
    private Boolean useFlag;
    //是否检测页码的有效性
    private Boolean checkFlag;
    //是否清除最后order by后面的语句
    private Boolean cleanOrderBy;
    //总条数
    private Integer totle;
    //总页数
    private Integer totalPage;
    //数据
    private List<T> tableData;
    
    public Integer getPage() {
        return page;
    }
    public void setPage(Integer page) {
        if(page <= 0) {
            page = 1;
        }
        
        this.page = page;
    }
    public Integer getPageSize() {
        return pageSize;
    }
    public List<T> getTableData() {
        return tableData;
    }
    public void setTableData(List<T> tableData) {
        this.tableData = tableData;
    }
    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
    public Boolean getUseFlag() {
        return useFlag;
    }
    public void setUseFlag(Boolean useFlag) {
        this.useFlag = useFlag;
    }
    public Boolean getCheckFlag() {
        return checkFlag;
    }
    public void setCheckFlag(Boolean checkFlag) {
        this.checkFlag = checkFlag;
    }
    public Boolean getCleanOrderBy() {
        return cleanOrderBy;
    }
    public void setCleanOrderBy(Boolean cleanOrderBy) {
        this.cleanOrderBy = cleanOrderBy;
    }
    public Integer getTotle() {
        return totle;
    }
    public void setTotle(Integer totle) {
        this.totle = totle;
    }
    public Integer getTotalPage() {
        return totalPage;
    }
    public void setTotalPage(Integer totalPage) {
        System.out.println(totalPage + ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + page);
        if(page > totalPage) {
            page = totalPage;
        }
        this.totalPage = totalPage;
    }
    public void init(Integer page, Integer pageSize, int totle) {
        
        this.page = page;
        this.pageSize = pageSize;
        this.totle = totle;
    }
    
    
}
